<template>
  <div class="tabBox">
    <el-tabs v-model="activeName">
      <el-tab-pane v-if="this.menuList.includes('userPermission')" label="人员管理" name="personnel">
        <personnel></personnel>
      </el-tab-pane>
      <el-tab-pane v-if="this.menuList.includes('rolePermission')" label="角色管理" name="role">
        <role></role>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import personnel from './components/personnel'
import role from './components/role'
export default {
  components: {
    personnel,
    role
  },
  data () {
    return {
      menuList: [],
      activeName: 'personnel',
      activeList: ['personnel', 'role']
    }
  },
  created () {
    this.menuList = sessionStorage.getItem('list')
    // let router = this.$router.history.current.path.substring(1)
    // if (this.$cookies.get('menu') === router) {
    //   if (this.activeList.includes(this.$cookies.get('activeName'))) {
    //     this.activeName = this.$cookies.get('activeName')
    //   }
    // }
    // if (this.menuList.includes('permissionList')) {
    //   this.activeName = 'personnel'
    // } else {
    //   this.activeName = 'role'
    // }
  }
}
</script>
